using System.Reflection;
using System.Text.RegularExpressions;

namespace DynamicConfigurationManager.ConfigMapAttributes
{
    internal class AssemblyPathRegEx : IConfigMapAttribute
    {
        public bool Execute( string configMapAttribute )
        {
            var assemblyPath = Assembly.GetExecutingAssembly().CodeBase;
            LogHelper.Append( "AssemblyPathRegEx: matching to {0}", assemblyPath );
            var re = new Regex( configMapAttribute, RegexOptions.IgnoreCase );
            return re.IsMatch( assemblyPath );
        }
    }
}